#include "keyboard.h"
#include <OgreKeyEvent.h>

using namespace Ogre;
using namespace std;

//************************************************************
// Implementation of Keyboard
//************************************************************
Keyboard::Keyboard()
  : mEscWasPressed(false)
{
}
void
Keyboard::keyClicked(KeyEvent *e)
{
  LogManager::getSingleton().logMessage("keyClicked");
  if (e->getKey() == KC_ESCAPE)
  {
    mEscWasPressed = true;
    e->consume();
  }
  
}
void
Keyboard::keyPressed(KeyEvent *e)
{
  LogManager::getSingleton().logMessage("keyPressed");    
}
void
Keyboard::keyReleased(KeyEvent *e)
{
  LogManager::getSingleton().logMessage("keyReleased");    
}
bool
Keyboard::frameEnded(const FrameEvent& evt)
{
  return !mEscWasPressed;
}
